//
//  HMHomeBottomCell.m
//  LoveFreshBeen
//
//  Created by huodian on 16/10/16.
//  Copyright © 2016年 魏根. All rights reserved.
//

#import "HMHomeBottomCell.h"

@implementation HMHomeBottomCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self setMyUI];
    }
    return self;
    
    
}
-(void)setMyUI
{
    
//    UIImageView* imageViewL = [[UIImageView alloc]init];
//    
//    [self.contentView addSubview:imageViewL];
//    
//    [imageViewL mas_makeConstraints:^(MASConstraintMaker *make) {
//       
//        make.top.leading.equalTo(self.contentView).offset(5);
//        
//        make.width.equalTo(self.contentView).multipliedBy(0.5).offset(-10);
//        
//        make.height.equalTo(imageViewL.mas_width);
//        
//    }];
//    
//    
//    
//    UIImageView* imageViewR = [[UIImageView alloc]init];
//    
//    [self.contentView addSubview:imageViewR];
//    
//    [imageViewR mas_makeConstraints:^(MASConstraintMaker *make) {
//        
//        make.top.equalTo(self.contentView).offset(5);
//        
//        make.trailing.equalTo(self.contentView).offset(-5);
//        
//        
//        make.height.width.equalTo(imageViewL);
//        
//    }];
//    
    
    UICollectionViewFlowLayout* layout = [[UICollectionViewFlowLayout alloc]init];
    
    UICollectionView* collection = [[UICollectionView alloc]initWithFrame:CGRectZero collectionViewLayout:layout];
    
    
    CGFloat imageW = (self.contentView.bounds.size.width - 10)/2;
    
    layout.itemSize = CGSizeMake(imageW, imageW);
    
    
    [self.contentView addSubview:collection];
    
    [collection mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.trailing.leading.bottom.equalTo(self.contentView);
        
        
    }];
    
    
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
